Fix typo and make create send proper bools
authorTom Wilkie <tom.wilkie@gmail.com>
Thu, 12 Apr 2007 10:31:17 +0000 (11:31 +0100)
committerTom Wilkie <tom.wilkie@gmail.com>
Thu, 12 Apr 2007 10:31:17 +0000 (11:31 +0100)
signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>

tools/python/xen/xm/create.dtd
tools/python/xen/xm/xenapi_create.py

index b83050444aa1937734d4acdea97218591124e099..719d113c842f160062173fc5eef392714b63fc1e 100644 (file)
@@ -95,7 +95,7 @@
                  src             %URI; #REQUIRED
                  type            %VDI_TYPE; #REQUIRED
                  size            CDATA #REQUIRED
-                 shareable       CDATA #REQUIRED
+                 sharable        CDATA #REQUIRED
                  read_only       CDATA #REQUIRED>
 
 <!ELEMENT name   (label, 
index 2f3b43165ac1ce9fcda35b725ab90758d2a3ec6f..e441de8026c4fbbf1aa00e6642b1bdef84cd007e 100644 (file)
@@ -212,8 +212,8 @@ class xenapi_create:
             "SR":               self.DEFAULT_STORAGE_REPOSITORY,  
             "virtual_size":     vdi.attributes["size"].value,
             "type":             vdi.attributes["type"].value,
-            "shareable":        vdi.attributes["shareable"].value,
-            "read_only":        vdi.attributes["read_only"].value,
+            "sharable":         bool(vdi.attributes["sharable"].value),
+            "read_only":        bool(vdi.attributes["read_only"].value),
             "other_config":     {"location":
                 vdi.attributes["src"].value}
             }
@@ -629,10 +629,10 @@ class sxp2xml:
         vdi.attributes["src"] = src
         vdi.attributes["read_only"] \
             = (get_child_by_name(vbd_sxp, "mode") != "w") \
-               and "true" or "false"
+               and "True" or "False"
         vdi.attributes["size"] = '-1'
         vdi.attributes["type"] = "system"
-        vdi.attributes["shareable"] = "false"
+        vdi.attributes["sharable"] = "False"
         vdi.attributes["name"] = name
 
         vdi.appendChild(self.make_name_tag(name, document))